<%= render 'public/flash_notice' %>
<div class="row">
  
  <ol class="breadcrumb">
    <li>新闻管理</li>
    <li>新闻列表</li>
  </ol>
  <table id="posts" class="table table-striped">
    <thead>
      <tr>
        <th>新闻标题</th>
        <th>语言</th>
        <th>创建时间</th>
        <th>修改时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <% @posts.each do |post| %>
        <tr>
          <td><%= link_to post.title ,post_path(post),target: '_blank'%></td>
          <td><%= language_for(post.language) %></td>
          <td><%= format_datetime(post.created_at, '%Y-%m-%d %H:%M') %></td>
          <td><%= format_datetime(post.updated_at, '%Y-%m-%d %H:%M') %></td>
          <td class="opts">
            <%= link_to '', [:cpanel, post],class:'icon-eye-open' %>
            <%= link_to '', edit_cpanel_post_path(post),class:'icon-edit' %>
            <%= link_to '', [:cpanel, post], method: :delete, data: { confirm: '确认删除' }, class: 'icon-trash'%>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <div class="paginate-right-position">
    <%= will_paginate @posts, previous_label: '上一页', next_label: '下一页' %>
  </div>
</div>
